// SETUP
var fontName = ("family-style")
var familyName = ("family")
var fontWeight = ("normal")
var fontStyle = ("normal")
var localName = ("Family Style")
var cssClass = (".family-style")
var fontAlts = ("serif")
var fontPath = ("/fonts/family-style/")
var cufonLocation = ("/fonts/cufon.js")

// DONT TOUCH UNLESS YOU KNOW WHAT YOU ARE DOING
var fontFaceStart = ("<style>@font-face {font-family: '" + fontName + "'; src: local('" + localName + "'), local('" + fontName + "'), url('" + fontPath + fontName )
var fontFaceEnd = (" font-weight: " + fontWeight + "; font-style: " + fontStyle + ";} " + cssClass + " {font-family: " + fontName + ", " + fontAlts + ";}</style>")

var nVer = navigator.appVersion;
var nAgt = navigator.userAgent;
var browserName  = navigator.appName;
var fullVersion  = ''+parseFloat(navigator.appVersion); 
var majorVersion = parseInt(navigator.appVersion,10);
var nameOffset,verOffset,ix;
var woff = ( fontFaceStart + ".woff') format('woff');" + fontFaceEnd )
var eot = ("<style>@font-face {font-family: '" + fontName + "'; src: url('" + fontPath + fontName + ".eot');" + fontFaceEnd )
var svg = ( fontFaceStart + ".svg#" + fontName + "') format('svg');" + fontFaceEnd )
var cufon = ("<script src='" + cufonLocation + "' type='text/javascript'></script><script src='" + fontPath + fontName + ".font.js' type='text/javascript'></script><script type='text/javascript'>Cufon.replace('" + cssClass + "', { fontFamily: '" + fontName + "' });</script>")

// iPAD
if ((navigator.userAgent.indexOf('/iPhone/i')) != -1) {
document.write(svg);
}

// MOBILE
else if (screen.width <= ("700")) {
document.write(cufon);
}

// MSIE
else if ((verOffset=nAgt.indexOf("MSIE"))!=-1) {
	document.write(eot);
}
// CHROME
else if ((verOffset=nAgt.indexOf("Chrome"))!=-1) {
document.write(svg);
}
// SAFARI
else if ((verOffset=nAgt.indexOf("Safari"))!=-1) {
	if ((fullVersion = nAgt.substring(verOffset+7))>=("259.67")) {
		document.write(svg);
	}
	else {
		document.write(cufon);
	}
}
// FIREFOX
else if ((verOffset=nAgt.indexOf("Firefox"))!=-1) {
	if ((fullVersion = nAgt.substring(verOffset+8))>=("3.6")) {
		document.write(woff);
	}
	else {
		document.write(cufon);
	}
}
// OPERA
else if ((verOffset=nAgt.indexOf("Opera"))!=-1) {
	document.write(svg);
}
// OTHER BROWSERS
else {
	document.write(cufon);
}

if ((ix=fullVersion.indexOf(";"))!=-1) fullVersion=fullVersion.substring(0,ix);
if ((ix=fullVersion.indexOf(" "))!=-1) fullVersion=fullVersion.substring(0,ix);

majorVersion = parseInt(''+fullVersion,10);
if (isNaN(majorVersion)) {
 fullVersion  = ''+parseFloat(navigator.appVersion); 
 majorVersion = parseInt(navigator.appVersion,10);
}